/**
 * Serfj扩展
 * @date 下午7:32:32
 */
package puziran.sofa.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


public class SerfjUtil {
	public static Map<String, String> removeFilter(Map<String, Object> map) {
		map.remove("EncodingFilter.FILTERED");
		Map<String, String> newmap = new HashMap<String, String>();
		// Iterator<String> it=map.keySet().iterator();
		for (Iterator<String> it = map.keySet().iterator(); it.hasNext();) {
			String type = (String) it.next();
			newmap.put(type, map.get(type).toString());
		}
		return newmap;
	}

	public static Map<String, String> paginationFilter(Map<String, String> map) {
		if (map.get("keyword") == null) {
			map.put("keyword", "");
		}
		if (map.get("skipCount") == null) {
			map.put("skipCount", "1");
		}
		if (map.get("pageSize") == null) {
			map.put("pageSize", "20");
		}
		return map;
	}
}
